extends Node

func _init() -> void:
	# Set your game's Steam app ID here
	OS.set_environment("SteamAppId", str(480))
	OS.set_environment("SteamGameId", str(480))

func _ready() -> void:
	initialize_steam()
	


func initialize_steam() -> void:
	var initialize_response: Dictionary = Steam.steamInitEx(true, 480)
	if initialize_response.get("status", 1) != 0:
		get_tree().quit()
	GameData.steam_id = Steam.getSteamID()
	print("Steam ID: %s" % GameData.steam_id)
	print("is loggon： ", Steam.loggedOn())
	print("subscribed: ", Steam.isSubscribed())
	if not Steam.loggedOn():
		get_tree().quit()
	if not Steam.isSubscribed():
		get_tree().quit()


func _process(_delta: float) -> void:
	if Steam.isSteamRunning():
		Steam.run_callbacks()
